<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			h1{
				font-size: 100px;
				font-family: "微软雅黑";
				text-align: center;
			}
		</style>
	</head>
	<body>
		<h1>00:00:00</h1>
		<script type="text/javascript">
			
			var index = 0;
		
			var  t = setInterval(function(){
				index = (index+1)%10;
				console.log(index);
			},2000);
			
			clearInterval(t);
			
			
			var t2 = setTimeout(function(){
				console.log("BOOM!");
			},2000);
			
			clearTimeout(t2);
		
			var h1 = document.getElementsByTagName("h1")[0];
			
			setInterval(function(){
				var now = new Date();
				var h = now.getHours();
				h = h<10?"0"+h:h;
				var m = now.getMinutes();
				m = m<10?"0"+m:m;
				var s = now.getSeconds();
				s = s<10?"0"+s:s;
				
				h1.innerText = h+":"+m+":"+s;
			},1000);
			
			
		</script>
		
	</body>
</html>
